import java.sql.ResultSet;
import java.sql.SQLException;

public class Test {
	public static String host = "localhost";
	public static String userName = "root";
	public static String password = "";
	public static String dbName = "test";
	
	public static void testSelect(){
		MysqlDB mysql = new MysqlDB(host, userName, password, dbName);
		
		String query = "select * from hdfs_size";
		
		ResultSet resultSet = mysql.executeQuery(query);
		
		try {
			while (resultSet.next()) {
			  String name = resultSet.getString("name");
			  String game = resultSet.getString("game");
			  int size_mb = resultSet.getInt("size_mb");
			  System.out.println("name: " + name);
			  System.out.println("game: " + game);
			  System.out.println("size_mb: " + size_mb);
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		mysql.close();
	}
	
	public static void testInsert(){
		MysqlDB mysql = new MysqlDB(host, userName, password, dbName);
		
		String query = "insert into test values('VH1', 15)";
		
		int result = mysql.executeNoneQuery(query);
		
		System.out.println("Result: " + result);
		
		mysql.close();
	}
}
